import defaultGenesis from "./default-genesis.json";
import { BlockchainConfigType } from "../config.type";

export const DefaultGenesis = (config: BlockchainConfigType, evmDenom: string, poaDenom: string): any => {
    defaultGenesis.genesis_time = new Date().toISOString();
    defaultGenesis.chain_id = `exrp_${config.chainId || "1440000"}-1`;

    defaultGenesis.app_state.crisis.constant_fee.denom = poaDenom;

    defaultGenesis.app_state.evm.params.evm_denom = evmDenom;

    defaultGenesis.app_state.gov.deposit_params.min_deposit = [
        {
            denom: evmDenom,
            amount: config.genesisConfig?.minDeposit || "50000000000000000000",
        },
    ];

    defaultGenesis.app_state.gov.voting_params.voting_period = `${config.genesisConfig?.bondingTimeInSeconds || "172800"}s`;

    defaultGenesis.app_state.staking.params.unbonding_time = `${config.genesisConfig?.bondingTimeInSeconds || "172800"}s`;
    defaultGenesis.app_state.staking.params.bond_denom = poaDenom;

    return defaultGenesis;
};
